Python for TensorFlow Pocket Primer by Oswald Campesato
Author:Oswald Campesato
Language: eng
Format: mobi, epub, pdf
Tags: python
Publisher: Mercury Learning and Information
Published: 2019-08-15T04:00:00+00:00
FIGURE 4.8 A Colored Square in a Grid of Line Segments.
RANDOMIZED DATA POINTS IN MATPLOTLIB
Listing 4.9 displays the contents of lin-reg-plot.py that illustrates how to plot a graph of random points.
LISTING 4.9: lin-plot-reg.py
import numpy as np
import matplotlib.pyplot as plt
trX = np.linspace(-1, 1, 101) # Linear space of 101 and [-1,1]
#Create the y function based on the x axis
trY = 2*trX + np.random.randn(*trX.shape)*0.4+0.2
#create figure and scatter plot of the random points
plt.figure()
plt.scatter(trX,trY)
# Draw one line with the line function
plt.plot (trX, .2 + 2 * trX)
plt.show()
Listing 4.9 defines the NumPy variable trX that contains 101 equally spaced numbers that are between -1 and 1 (inclusive). The variable trY is defined in two parts: the first part is 2*trX and the second part is a random value that is partially based on the length of the one-dimensional array trX. The variable trY is the sum of these two “parts,” which creates a “fuzzy” line segment. The next portion of Listing 4.9 creates a scatterplot based on the values in trX and trY, followed by the Pyplot API plot() that renders a line segment.
Figure 4.9 displays a random set of points based on the code in Listing 4.9.
Download
Python for TensorFlow Pocket Primer by Oswald Campesato.epub
Python for TensorFlow Pocket Primer by Oswald Campesato.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Ada | Ajax |
Assembly Language Programming | Borland Delphi |
C & C++ | C# |
CSS | Compiler Design |
Compilers | DHTML |
Debugging | Delphi |
Fortran | Java |
Lisp | Perl |
Prolog | Python |
RPG | Ruby |
Swift | Visual Basic |
XHTML | XML |
XSL |
Hello! Python by Anthony Briggs(9913)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9795)
The Mikado Method by Ola Ellnestam Daniel Brolund(9777)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8295)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7778)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7763)
Grails in Action by Glen Smith Peter Ledbrook(7696)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7557)
Windows APT Warfare by Sheng-Hao Ma(6818)
Layered Design for Ruby on Rails Applications by Vladimir Dementyev(6547)
Blueprints Visual Scripting for Unreal Engine 5 - Third Edition by Marcos Romero & Brenden Sewell(6414)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6409)
Kotlin in Action by Dmitry Jemerov(5062)
Hands-On Full-Stack Web Development with GraphQL and React by Sebastian Grebe(4316)
Functional Programming in JavaScript by Mantyla Dan(4037)
Solidity Programming Essentials by Ritesh Modi(3992)
WordPress Plugin Development Cookbook by Yannick Lefebvre(3782)
Unity 3D Game Development by Anthony Davis & Travis Baptiste & Russell Craig & Ryan Stunkel(3723)
The Ultimate iOS Interview Playbook by Avi Tsadok(3699)
